<%@page language="java" contentType="text/html; charset=utf-8"%>
<%@include file="/tagDeclare.jsp"%>
<%@include file="/headDeclare.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>福建青年墙体资源管理系统</title>
	<style type="text/css">
		html,body,p,form,input,label,div,img,iframe {margin:0; padding:0;}
		body {font-family: 宋体, Simsun;}
/* 		#loginForm {margin:5px 10px 5px 10px;} */
		#loginForm label{margin-right:10px; vertical-align: middle;}
		#loginForm p{font-size: 11px; line-height: 30px;}
		#vericode_text{padding: 0 6px; margin-right:6px; height: 20px; width:45px; vertical-align: middle;}
		.input{padding: 0 6px; margin-right:6px; height: 20px; width:100px; vertical-align: middle; }
		.button{font-size: 12px; width: 65px; height: 24px; line-height: 20px; margin-left: 5px; }
	</style>
	<script type="text/javascript">
        var href = location.href;
        var parentHref = parent.location.href;
        if(parentHref != href && href.indexOf("login.do") != -1) parent.location.href = "login.do";
	
		$(document).ready(function () {
			$.ajaxSetup ({ cache:false, async:false});
			
		 	$.ligerDialog.open({ width:1024,height:680, allowClose:false, title:'登录', target:$("#target1") });

		 	$("#vericode-btn").click(function(){
		 		$('#vericode-img').attr('src', 'vericode.do?' + Math.random());
		 	});

            var options = {dataType: 'json', success : process};
		 	$("#loginForm").submit(function(){
                $(this).ajaxSubmit(options);
                return false;
		 	});

		 	$('#vericode-img').attr('src', 'vericode.do?' + Math.random());
		 	$("#p_error").hide();
		 	$("#username").focus();
		 	
		 	$("#visitor").click(function(){
		 		location.href = "index.do";
		 	});
		 });

		 function process(responseJson) {
            if(responseJson.code == 0) {
                $('#error_label').text("提示：" + responseJson.message);
                $("#p_error").show();
                $("#username").focus();
                $("#vericode-btn").click(); 
                return;
            }
            location.href = "index.do";
		 }
	</script>
</head>

<body >
	<div id="target1" style=" display:none;background:url('images/login_bg.jpg');background-position:center; width: 100%;height: 100%;margin-left: auto;margin-right: auto;">
	<form id="loginForm" method="post" action="login.do">
		<div>
			<p id = "p_error" style="position: absolute;left: 395px;top: 285px;">
				<label id="error_label" for="error_text" style="color:red;">错&nbsp;&nbsp;误：${error}</label>
			</p>
<!-- 			<p style="text-align: right;vertical-align: bottom;"> -->
<!-- 				<label id="account_label" for="username">账&nbsp;&nbsp;号</label> -->
				<input type="text" style="position: absolute;left: 382px;top: 216px;" id="username" name="username" class="input" value="${username}"/>
<!-- 			</p> -->
<!-- 			<p style="text-align: right;vertical-align: bottom;"> -->
<!-- 				<label id="pass_label" for="password">密&nbsp;&nbsp;码</label> -->
				<input type="password" style="position: absolute;left: 382px;top: 241px;" id="password" name="password" class="input" value="${password}"/>
<!-- 			</p> -->
				
				<input type="text" style="position: absolute;left: 382px;top: 266px;" id="vericode_text" name="vericode" />
				<img id="vericode-img" style="position: absolute;left: 445px;top: 266px;vertical-align:middle; margin-right: 6px;height: 22px;" src=""   />
				<input id="vericode-btn" style="position: absolute;left: 500px;top: 266px;" type="button" value="刷新"  class="button"  />
<!-- 			<p style="text-align: right;"> -->
				<input type="submit" style="position: absolute;left: 500px;top: 216px;" value="登录" class="button" />
				<input style="position: absolute;left: 500px;top: 241px;" type="button" id="visitor" value="游客登录"  class="button"  />
<!-- 				<a href="index.do" style="text-decoration:none;">游客登录</a> -->
<!-- 			</p> -->
		</div>		
	</form>
	</div>
 <div style="display:none;">     
</div>
</body>
</html>
    